import axios from '@/tool/axiso.js'

/**
 * 
 *
 */
// 登录
export const login = (obj) => axios.post('login', obj)
// 左侧导航栏渲染
export const menus = () => axios.get('menus')
// 用户列表数据渲染
export const users = (obj) => axios.get('users', {
    params: obj
})
// 添加
export const Adduser = (obj) => axios.post('users', obj)
// 删除
export const Delusers = (id) => axios.delete(`users/${id}`)
// 修改用户状态
export const isEdit = (uid, flag) => axios.put(`users/${uid}/state/${flag}`)
//根据ID查询用户信息 数据回填
export const UserID =(id)=>axios.get(`users/${id}`)
// 编辑用户
export const Editor = (obj) =>axios.put(`users/${obj.EditID}`,obj)
//分配角色 数据回填
export const dealUser =(obj) =>axios.put(`users/${obj.id}/role`,obj)
export const UserRoles =() =>axios.get('/roles')
